﻿using System.ServiceProcess;
using Sustainalytics.Insights.BusinessLogic;
using Sustainalytics.DataLayer;
using System.Configuration;
using System;
using Sustainalytics.Utils.Serilog;

namespace Sustainalytics.Insights.Service
{
    /// <summary>
    /// Windows Service Startup.
    /// </summary>
    public static class ProgramWindowsService
    {
        private static AutoUnpublish updater;

        public static void Start()
        {
            var repository = new InsightRepository(ConfigurationManager.ConnectionStrings["ClientPlatform"].ConnectionString);
            updater = new AutoUnpublish(repository);
            ServiceBase.Run(new InsightsService());
        }
    }
}
